﻿using WeDonekRpc.Helper.UAParser;
using WeDonekRpc.Modular;

namespace Basic.HrOperateLogModular
{
    internal static class LinqHelper
    {
        private static readonly Parser _UAgentParser = null;

        static LinqHelper ()
        {
            _UAgentParser = Parser.GetDefault();
        }

        public static long ToEmpId ( this IUserState state )
        {
            return state.GetValue<long>("UserId");
        }
        public static string ToUserType ( this IUserState state )
        {
            return state.GetValue<string>("UserType");
        }
        public static string ToUnitDept ( this IUserState state )
        {
            return state.GetValue<string>("UnitDept");
        }
        public static string ToEmpName ( this IUserState state )
        {
            return state.GetValue<string>("EmpName");
        }
        public static long ToCompanyId ( this IUserState state )
        {
            return state.GetValue<long>("CompanyId");
        }
    }
}
